package com.xidian.zhiancloud.dao.riskcontrol.riskidenva;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.xidian.zhiancloud.model.riskcontrol.TRiskIdentEvalStatusList;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 风险辨识评价计划
 */
public interface TRiskIdentEvalStatusMapper extends BaseMapper
        <TRiskIdentEvalStatusList> {

    //超级管理员登录
    Page<TRiskIdentEvalStatusList> getTRiIdeEvalStaSuperAdmin(
            @Param("searchkey") String searchkey,
            @Param("companyId") Long companyId,
            @Param("state") String state,
            @Param("riskpointType") String riskpointType,
            @Param("userId") String userId,
            String discerner,String evaluator,String auditor,String type);

    Page<TRiskIdentEvalStatusList>  getTRiIdeEvalSta(
        @Param("searchkey") String searchkey,
        @Param("companyId") Long companyId,
        @Param("state") String state,
        @Param("riskpointType") String riskpointType,
        @Param("userId") String userId,
        @Param("discerner") String discerner,
        @Param("evaluator") String evaluator,String type);
    
    List<TRiskIdentEvalStatusList>  getTRiskIdentEvalStatusCreateId(
        @Param("companyId") Long companyId,@Param("userId") String userId);

    List<String> getTRiskIdentEvalStatusAndRecipientIdList(@Param("companyId") Long companyId);

    TRiskIdentEvalStatusList getByIds(@Param("companyId") Long companyId,@Param("id") String id);

    //风险评价审核里面的列表
    Page<TRiskIdentEvalStatusList> getTRiIdeEvalStaAudit(
            @Param("searchkey") String searchkey,
            @Param("companyId") Long companyId,
            @Param("state") String state,
            @Param("riskpointType") String riskpointType,
            @Param("auditor") String auditor,
            @Param("type") String type,
            @Param("userId") String userId);

    List<TRiskIdentEvalStatusList> getById(@Param("companyId") Long companyId,
                 @Param("id") String id);

    int removeTRiskIdentEvalStatus(List<String> list);

    //编辑
    int updateTRiskIdentEvalStatus(String riskName, Date startTime, Date deadlineIden,
         Date deadlineEval, String remarks,String riskpointType,@Param("id") String id);

    //添加
    int insertTRiskIdentEvalStatusList(
            @Param("data") TRiskIdentEvalStatusList data,
            @Param("companyId") Long companyId);

    //发布(之后的状态为分解中)
    int releaseRiskIdenEva(@Param("companyId") Long companyId,
                           @Param("id") String id,
                           @Param("state") String state,String recipientIds);

    TRiskIdentEvalStatusList selectByCompanyIdAndRiskName
            (@Param("companyId") Long companyId,
             @Param("riskName") String riskName);

    //派发按钮(派发之后的状态为辨识中)
    int decomposeRiskIdenEva(@Param("companyId") Long companyId,
        @Param("id") String id,@Param("state") String state,String recipientIds);

    //风险辨识提交按钮后的状态为--待评价
    int identificationRiskIdenEva(@Param("companyId") Long companyId,
        List<String> list,@Param("state") String state,String recipientIds);

    //评价后的待审核的状态
    int evaluateRiskIdenEva(@Param("companyId") Long companyId,
        List<String> list,@Param("state") String state,String recipientIds);

    int evaluationRiskIdenEvaAudit(@Param("companyId") Long companyId,
                                  @Param("id") String id);

    //派发按钮(派发之后的状态为辨识中)
    int evaluationDecomposeRiskIdenEva(@Param("companyId") Long companyId,
        @Param("id") String id,@Param("state") String state,String recipientIds);

    //派发按钮(派发之后的状态为辨识中)
    int auditDecomposeRiskIdenEva(@Param("companyId") Long companyId,
        @Param("id") String id,@Param("state") String state);

    Page<TRiskIdentEvalStatusList> getById(
            @Param("searchkey") String searchkey,
            @Param("companyId") Long companyId,
            String id);

    //部门审核不通过
    int depaNoPassReview( @Param("companyId") Long companyId,
                    @Param("id") String id, @Param("state") String state,String recipientIds);

    //部门审核通过
    int depaPassReview( @Param("companyId") Long companyId,
                    @Param("id") String id, @Param("state") String state,String recipientIds);

    //安全部门不通过
    int securityNoPassReview( @Param("companyId") Long companyId,
                        @Param("id") String id, @Param("state") String state,String recipientIds);

    //安全部门通过
    int securityPassReview( @Param("companyId") Long companyId,
                        @Param("id") String id, @Param("state") String state,String recipientIds);


    //最终审核不通过
    int finalNoPassReview( @Param("companyId") Long companyId,
                     @Param("id") String id, @Param("state") String state,String recipientIds);

    //最终审核通过
    int finalPassReview( @Param("companyId") Long companyId,
                     @Param("id") String id, @Param("state") String state,String recipientIds);


    Page<TRiskIdentEvalStatusList> getExportRiskIdentEvalStatusList
            (@Param("companyId") Long companyId,List<Object> list);

}
